package admin

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/admin/system"
)

func (c *ControllerSystem) AdminCreate(ctx context.Context, req *system.AdminCreateReq) (res *system.AdminCreateRes, err error) {
	res = new(system.AdminCreateRes)
	res.Id, err = service.SystemUser().Create(ctx, model.SystemUserCreateInput{
		Username: req.Username,
		Name:     req.Name,
		Avatar:   req.Avatar,
		RoleIds:  req.RoleIds,
		Phone:    req.Phone,
	})
	return
}
